import service from '@/utils/request'

export const postApiList = (name: string) => {
	if(name=='page'){
		return '/sys/post/list';
	}else if(name=='delete'){
		return '/sys/post/del';
	}
	return "";
}

export const usePostApi = (id: Number) => {
	return service.get('/sys/post/get?ids=' + id)
}

export const usePostSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.post('/sys/post/edit', dataForm)
	} else {
		return service.post('/sys/post/add', dataForm)
	}
}

export const usePostListApi = () => {
	return service.get('/sys/post/selectpage')
}
